package cn.fuego.busrental.ui.user;

import java.util.ArrayList;
import java.util.List;

import cn.fuego.busrental.R;
import cn.fuego.busrental.R.layout;
import cn.fuego.misp.ui.list.MispListActivity;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.RadioButton;

public class ContainBusOrderActivity extends MispListActivity<String> {

	private RadioButton r1,r2,r3,r4;
	private List<String> list=new ArrayList<String>();
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}

	public static void jump(Context context)
	{
		Intent intent = new Intent();
		intent.setClass(context, ContainBusOrderActivity.class);		
		context.startActivity(intent);
	}

	@Override
	protected void initView()
	{
		r1=(RadioButton) findViewById(R.id.radiobutton1);
		r2=(RadioButton) findViewById(R.id.radiobutton2);
		r3=(RadioButton) findViewById(R.id.radiobutton3);
		r4=(RadioButton) findViewById(R.id.radiobutton4);
		this.listViewRes.setListView(R.id.contain_order_list);
		this.listViewRes.setListItemView(R.layout.item_near_play);
		list.add("1");
		list.add("1");
		list.add("1");
		list.add("1");
		this.refreshList(list);
	}

	@Override
	public void onItemListClick(AdapterView<?> parent, View view, long id,
			String item) {
	   OrderInfoActivity.jump(this);
	}

	@Override
	public View getListItemView(View view, String item) {
		// TODO Auto-generated method stub
		return view;
	}

	@Override
	public void initRes() {
		this.activityRes.setAvtivityView(R.layout.activity_order_list);
		this.activityRes.getButtonIDList().add(R.id.radiobutton1);
		this.activityRes.getButtonIDList().add(R.id.radiobutton2);
		this.activityRes.getButtonIDList().add(R.id.radiobutton3);
		this.activityRes.getButtonIDList().add(R.id.radiobutton4);
	}

	@Override
	public void onClick(View v) {
	switch (v.getId()) {
	case R.id.radiobutton1:
		if(r1.isChecked())
		{
		r1.setTextColor(this.getResources().getColor(R.color.white));
		r2.setTextColor(this.getResources().getColor(R.color.themecolor));
		r3.setTextColor(this.getResources().getColor(R.color.themecolor));
		r4.setTextColor(this.getResources().getColor(R.color.themecolor));
		}
		break;
	case R.id.radiobutton2:
		if(r2.isChecked())
		{
		r1.setTextColor(this.getResources().getColor(R.color.themecolor));
		r2.setTextColor(this.getResources().getColor(R.color.white));
		r3.setTextColor(this.getResources().getColor(R.color.themecolor));
		r4.setTextColor(this.getResources().getColor(R.color.themecolor));
		}
			break;
	case R.id.radiobutton3:
		if(r3.isChecked())
		{
		r1.setTextColor(this.getResources().getColor(R.color.themecolor));
		r2.setTextColor(this.getResources().getColor(R.color.themecolor));
		r3.setTextColor(this.getResources().getColor(R.color.white));
		r4.setTextColor(this.getResources().getColor(R.color.themecolor));
		}
		break;
	case R.id.radiobutton4:
		if(r4.isChecked())
		{
		r1.setTextColor(this.getResources().getColor(R.color.themecolor));
		r2.setTextColor(this.getResources().getColor(R.color.themecolor));
		r3.setTextColor(this.getResources().getColor(R.color.themecolor));
		r4.setTextColor(this.getResources().getColor(R.color.white));
		}
		break;

	default:
		break;
	}
	}
	
	
}
